package com.waterfairy.note.utils;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * @author water_fairy
 * @email 995637517@qq.com
 * @date 2020/9/7 14:12
 * @info:
 */
public class ShareUtils {
    public static final String DEFAULT_URL = "http://www.waterfairy.xyz";


    public static String getUrl(Context context) {
        SharedPreferences mac = context.getSharedPreferences("setting", Context.MODE_PRIVATE);
        return mac.getString("url", DEFAULT_URL);
    }

    public static void saveUrl(Context context, String url) {
        SharedPreferences mac = context.getSharedPreferences("setting", Context.MODE_PRIVATE);
        mac.edit().putString("url", url).apply();
    }
}
